use num::BigUint;
use num::One;
pub fn new_birthday_probability(n: u32) -> f64 {
    let total: BigUint = BigUint::from(365_u32).pow(n);

    let mut result = BigUint::one();
    for i in 0..n {
        result *= BigUint::from(365 - i);
    }

    let day = &total - &result;
    let total_f = total
        .to_str_radix(10)
        .parse::<f64>()
        .unwrap_or(f64::INFINITY);
    let day_f = day.to_str_radix(10).parse::<f64>().unwrap_or(f64::INFINITY);

    day_f / total_f
}
